import request from '../utils/request'

// 获取美食列表  name 餐厅名字 pageNum 页码数  pageSize 每页展示的数据条数
export const getFoodList = (params) => {
    return request.get('/app/findAllfood', params )
}

// 添加美食  fname: ,fpicture: ,furl: ,ingredients 食材 ,practice 做法， rid 餐厅名
export const addFood = (params) => {
    return request.post('/addfood', params)
}

// 修改美食 fname: ,fpicture: ,furl: ,ingredients 食材 ,practice 做法， rid 餐厅名
export const updateFood = (params) => {
   return request.put('/updateFood', params)
}

// 删除美食 fid
export const deleteFood = (id) => {
    return request.del(`/deletefood?fid=${id}`)
}

// 获取美食详情 fid
export const foodDetails = (params) => {
    return request.get('/app/findFood', params)
}

// 获取美食店铺列表 name pageSize pageNum
export const storeList = (params) => {
    return request.get('/app/findAllRestaurant', params)
}

// 添加美食店铺  	perCapita 人均,rpicture,shopAddress ,shopScore ,shopname
export const addStore = (params) => {
    return request.post('/addRestaurant', params)
}

// 修改美食店铺 perCapita 人均,rid: 0,rpicture,shopAddress ,shopScore ,shopname
export const updateStore = (params) => {
    return request.put('/updateRestaurant', params)
}

// 删除美食店铺 rid
export const  deleteStore = (id) => {
    return request.del(`/deleteRestaurant?rid=${id}`)
}

// 获取美食店铺详情  foodpageNum foodpageSize pageNum pageSize  rid
export const storeDetails = (params) => {
    return request.get('/app/getRestBysId', params)
}